package com.bw.controller;


import com.bw.entity.Role;
import com.bw.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 飓风微尘
 * @since 2022-05-01
 */
@RestController
@RequestMapping("/role")
@CrossOrigin
public class RoleController {
    @Autowired
    IRoleService roleService;
    @RequestMapping("list")
    public ResponseEntity list(){
        List<Role> list = roleService.list();
        return new ResponseEntity(list, HttpStatus.OK);
    }
}
